From: Florian Müllner Date: Sat, 16 Jan 2021 00:43:53 +0000 (+0100) Subject: extensionsService: Fix setting prefs dialog parent X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~590 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a32df6b7a3853f9e254d5fa9b1748608354ec070;p=gnome-shell.git extensionsService: Fix setting prefs dialog parent Between the GTK4 port and the latest GTK4 version, calling realize() on a newly created window to force its surface to be created stopped working. So instead, wait for the window to get realized regularly to set its parent. Part-of: --- diff --git a/js/dbusServices/extensions/extensionsService.js b/js/dbusServices/extensions/extensionsService.js index 8217675b0..35e780578 100644 --- a/js/dbusServices/extensions/extensionsService.js +++ b/js/dbusServices/extensions/extensionsService.js @@ -120,15 +120,15 @@ var ExtensionsService = class extends ServiceImplementation { const extension = ExtensionUtils.deserializeExtension(serialized); const window = new ExtensionPrefsDialog(extension); - window.realize(); + window.connect('realize', () => { + let externalWindow = null; - let externalWindow = null; + if (parentWindow) + externalWindow = Shew.ExternalWindow.new_from_handle(parentWindow); - if (parentWindow) - externalWindow = Shew.ExternalWindow.new_from_handle(parentWindow); - - if (externalWindow) - externalWindow.set_parent_of(window.get_surface()); + if (externalWindow) + externalWindow.set_parent_of(window.get_surface()); + }); if (options.modal) window.modal = options.modal.get_boolean();